package com.acctrue.zentao.enums;

/**
 * @author: 孙炯炯
 * @since: 2024/9/5
 **/
public enum TaskStatusEnum {
    /**
     * 任务状态
     */
    wait("wait", "未开始"),
    doing("doing", "进行中"),
    done("done", "已完成"),
    pause("pause", "已暂停"),
    cancel("cancel", "已取消"),
    closed("closed", "已关闭"),
    ;
    private final String value;
    private final String name;

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    TaskStatusEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public static String getNameByValue(String value) {
        for (TaskStatusEnum e : TaskStatusEnum.values()) {
            if (e.getValue().equals(value)) {
                return e.name;
            }
        }
        return "";
    }
}
